home *** CD-ROM | disk | FTP | other *** search
/ Secrets of Stargate / STARGATE.iso / mac / STARGATE (5MB Macintosh) / STARGATE (5MB Macintosh).DXR / 00003_Storyboard Scripts.ls < prev    next >
Encoding:
Text File  |  1994-10-19  |  2.8 KB  |  120 lines

  1. on prevSB
  2.   global gSBState
  3.   if the timer < 20 then
  4.     exit
  5.   end if
  6.   set curRecord to item 1 of gSBState
  7.   if curRecord = 1 then
  8.     set curRecord to value(item 2 of gSBState)
  9.   else
  10.     set curRecord to curRecord - 1
  11.   end if
  12.   updateSB(curRecord)
  13.   startMouse()
  14. end
  15.  
  16. on nextSB
  17.   global gSBState
  18.   set curRecord to item 1 of gSBState
  19.   if curRecord >= value(item 2 of gSBState) then
  20.     set curRecord to 1
  21.   else
  22.     set curRecord to curRecord + 1
  23.   end if
  24.   updateSB(curRecord)
  25.   startMouse()
  26. end
  27.  
  28. on updateSB curRecord
  29.   global gSBState, gResourcePath
  30.   set curRecord to value(curRecord)
  31.   put curRecord into item 1 of gSBState
  32.   debug("R: " & curRecord)
  33.   set sbTxtHdr to field "SBTXT_0"
  34.   set numChunks to line 1 of sbTxtHdr
  35.   delete line 1 of sbTxtHdr
  36.   repeat with z = 1 to the number of lines in sbTxtHdr
  37.     set sRec to word 1 of line z of sbTxtHdr
  38.     set eRec to word 2 of line z of sbTxtHdr
  39.     if (curRecord >= sRec) and (curRecord <= eRec) then
  40.       exit repeat
  41.     end if
  42.   end repeat
  43.   set theLine to curRecord - sRec + 1
  44.   set theData to line theLine of field ("SBTXT_" & z)
  45.   set backMsg to "showSBs " & value(item 1 of gSBState)
  46.   set the itemDelimiter to "|"
  47.   set theFrame to item 1 of theData
  48.   set theMovLinks to putBackChars(item 6 of theData)
  49.   set theStillLinks to putBackChars(item 7 of theData)
  50.   set the movieTime of sprite 31 to theFrame * 60
  51.   updateLinkIcons(backMsg, EMPTY, theStillLinks, theMovLinks, 0, 0)
  52.   put item 4 of theData & "  " & item 8 of theData into field "SB_Name"
  53.   put putBackChars(item 5 of theData) into field "SB_Caption"
  54.   set the itemDelimiter to ","
  55.   updateStage()
  56.   set the visible of sprite 31 to 1
  57.   updateStage()
  58.   set the movieTime of sprite 31 to theFrame * 60
  59.   set the visible of sprite 31 to 1
  60.   updateStage()
  61. end
  62.  
  63. on sbClick sN
  64.   if voidp(sN) then
  65.     set sN to the clickOn
  66.   end if
  67.   spinCursor()
  68.   hiliteAnim(sN, EMPTY)
  69.   set the visible of sprite 31 to 0
  70.   showSBs(line sN - 5 of field "SBTXT_PD")
  71. end
  72.  
  73. on showSBs theNum
  74.   global gOnPC
  75.   spinCursor()
  76.   if (theNum = EMPTY) or voidp(theNum) then
  77.     set theNum to 1
  78.   end if
  79.   if gOnPC then
  80.     pause()
  81.   end if
  82.   set the visible of sprite 31 to 0
  83.   put " " into field "SB_Name"
  84.   put " " into field "SB_Caption"
  85.   LinkTo("SB BG")
  86.   updateSB(theNum)
  87.   continue()
  88.   updateStage()
  89.   resetCursor()
  90. end
  91.  
  92. on sbSlideShow
  93.   global gSlideDelay
  94.   stopCursor()
  95.   set continue to 1
  96.   set firstClick to the clickLoc
  97.   repeat while continue
  98.     nextSB()
  99.     idle()
  100.     set theDelay to 60 * integer(gSlideDelay)
  101.     if theDelay < 60 then
  102.       set theDelay to 60
  103.     end if
  104.     repeat with z = 1 to theDelay
  105.       wait(1)
  106.       if (the mouseDown = 1) or (the clickLoc <> firstClick) then
  107.         set continue to 0
  108.         exit repeat
  109.       end if
  110.     end repeat
  111.     if continue <> 1 then
  112.       exit repeat
  113.     end if
  114.     updateStage()
  115.     idle()
  116.   end repeat
  117.   resetCursor()
  118.   startMouse()
  119. end
  120.